package com.nashuju.web.controller.role;

import org.durcframework.core.controller.SearchController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.nashuju.web.entity.role.UserRole;
import com.nashuju.web.entity.role.UserRoleParam;
import com.nashuju.web.entity.user.UserSch;
import com.nashuju.web.service.role.UserRoleService;

@Controller
public class UserRoleController extends SearchController<UserRole, UserRoleService> {

    /**
     * 获取用户所有角色
     * @param searchEntity
     * @return
     */
    @RequestMapping("/listUserRRole.do")
    public @ResponseBody Object listUserRRole(UserSch searchEntity) {
        return this.queryAll(searchEntity);
    }

    @RequestMapping("/setUserRole.do")
    public @ResponseBody Object setUserRole(UserRoleParam userRoleParam) {
        this.getService().setUserRole(userRoleParam);
        return success();
    }
}
